<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        Array.prototype.myPush = function(...elements)
        {
            let length = elements.length;
            for(let i = 0;i<elements.length;i++)
            {
                this[length+i] = elements[i];
            }

            this.length = this.length+elements.length;
        }

        let arr1 = [1,2,3,4];
        let arr2 = [10,5,6,7,8];
        arr1.push(...arr2);
        console.log(arr1);
    </script>
</body>
</html>